
#ifndef HELMETGLOBALS_H
#define HELMETGLOBALS_H

/**************************************************************************************
	Definitions
**************************************************************************************/
// helper macros
#define Finished(x)					( x=0 )
#define DoInMain(x)					( x++ )

// fuel gauge
#define FUEL_GAUGE_CHECK_INTERVAL	4

// timer(s)
#define T1_FREQ 	100 // frequency of T1 interrupt

/**************************************************************************************
	Global Variables
**************************************************************************************/
// GPS
unsigned short int GPSQuery = 0; // query GPS status
unsigned short int GPSAlive = 3; // assume GPS is very alive (2 seconds to respond)
unsigned short int ReadGPSMessage = 0; // do not read a GPS message
unsigned short int InterpretGPSMessage = 0; // do not interpret a GPS message
unsigned short int ReportGPSFailure = 0; // GPS has not failed

// accelerometer/thermometer
unsigned char ConvertADC = 0; // ADC conversion not completed
unsigned int ReportHangTime = 0; // Do not report hang-time value
unsigned short int ReportAverages = 0; // do not report averages

// fuel gauge
unsigned int CheckFuelGauge = FUEL_GAUGE_CHECK_INTERVAL-1; // check fuel gauge @ start

// buttons
char prevButton = 0;
unsigned short int CheckRemoteButtonPad = 0;
unsigned short int CheckAttachedButtonPad = 0;

// external interrupts
unsigned short int Sleeping = 0;
unsigned short int EnterSleepMode = 0;
unsigned short int ExitSleepMode = 0;

// performance measurement
unsigned int MainLoopIterationsPerSecond = 0;
unsigned short int ReportMLIPS = 0;


#endif